#define MAXNUM 10
#define ELEMTYPE int

typedef struct
{
	ELEMTYPE queue[MAXNUM];
	int front;
	int rear;
}QQType;

void initiateQQueue( QQType *q )
{
	q->front = -1;
	q->rear = -1;
}

int appendQQueue( QQType *q, ELEMTYPE e ){
	if( ((q->rear + 1) % MAXNUM) == q->front )
	{
		printf( "!!queue is full!!" );
		return 0;
	}

	q->rear = (q->rear + 1) % MAXNUM;
	q->queue[q->rear] = e;
	return 1;
}

int delQQueue( QQType *q, ELEMTYPE *e ){
	if( q->front == q->rear){
		printf( "!!queue is empty!!" );
		return 0;
	}
	
	q->front = (q->front + 1) % MAXNUM;
	*e = q->queue[ q->front ];
	return 1;
}

